﻿/**
 *
 * @file FITKAbaqusHDF5AdaptorSection.h
 * @brief 读写HDF5文件的Section类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-05-31
 *
 */
#ifndef  _FITKABAQUSHDF5ADAPTORPROFILE_H__
#define  _FITKABAQUSHDF5ADAPTORPROFILE_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorSection.h"

 //前置声明
ForwardDeclarNS(Interface, FITKAbstractSection)
ForwardDeclarNS(Interface, FITKAbaAbastractSection)
ForwardDeclarNS(Interface, FITKAbstractMaterial)
ForwardDeclarNS(Interface, FITKAbaProfile)
ForwardDeclarNS(Interface, FITKSectionAssign)

namespace IO
{
    /**
     * @brief HDF5 Profile 剖面 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-05-31
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorProfile : public FITKAbstractHDF5Adaptor
    {
    public:
        explicit FITKAbaqusHDF5AdaptorProfile() = default;
        virtual ~FITKAbaqusHDF5AdaptorProfile() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptW() override;

    private:

        /**
         * @brief 读取 剖面
         * @param profile 剖面
         * @param h5Group 数据块
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-25
         */
        bool readProfile(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfileBox(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfileCircular(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfileI(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfileL(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfilePipe(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool readProfileRectangular(Interface::FITKAbaProfile* profile, H5::Group& h5Group);


        /**
         * @brief 写出 剖面
         * @param profile 剖面
         * @param h5Group 数据块
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-25
         */
        bool writeProfile(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfileBox(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfileCircular(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfileI(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfileL(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfilePipe(Interface::FITKAbaProfile* profile, H5::Group& h5Group);
        bool writeProfileRectangular(Interface::FITKAbaProfile* profile, H5::Group& h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaProfile, FITKAbaqusHDF5AdaptorProfile)

}

#endif
